home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / suplib / getcwd.c < prev    next >
C/C++ Source or Header  |  1993-09-03  |  273b  |  23 lines

  1.  
  2. #include <stdlib.h>
  3. #include <unistd.h>
  4. #include <sys/param.h>
  5.  
  6. #ifdef next
  7. #include <libc.h>
  8.  
  9. char *
  10. getcwd(char *buf, int maxlen)
  11. {
  12.     char xbuf[MAXPATHLEN];
  13.  
  14.     if (getwd(xbuf)) {
  15.     strncpy(buf, xbuf, maxlen);
  16.     return(buf);
  17.     } else {
  18.     return(NULL);
  19.     }
  20. }
  21.  
  22. #endif
  23.